<template>
  <div>
    <el-row :gutter="15">

      <el-tabs v-model="activexdivdv" tab-position="top" class="mb-20">
        <el-tab-pane label="原数据">
          <el-form ref="elForm" :model="dataForm.oldData" :rules="dataRule" size="small" label-width="130px"
                   label-position="right" :disabled="true"
          >
            <template>
              <!--          v-if="!loading && formOperates"-->
              <el-card class="mb-20" shadow="always" header="照片信息">
                <el-col :span="8" v-if="judgeShow('jnpf_zcgl_zcdj_photo_jnpf_photoTime')"
                >
                  <el-form-item label="近照日期"
                                prop="jnpf_zcgl_zcdj_photo_jnpf_photoTime"
                  >
                    <el-date-picker v-model=" dataForm.oldData.jnpf_zcgl_zcdj_photo_jnpf_photoTime"
                                    placeholder="请选择" :disabled="judgeWrite('jnpf_zcgl_zcdj_photo_jnpf_photoTime')"
                                    clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
                                    value-format="timestamp"
                    >
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="24" v-if="judgeShow('jnpf_zcgl_zcdj_photo_jnpf_photoImage')"
                >
                  <el-form-item label="近照图片"
                                prop="jnpf_zcgl_zcdj_photo_jnpf_photoImage"
                  >
                    <JNPF-UploadImg v-model=" dataForm.oldData.jnpf_zcgl_zcdj_photo_jnpf_photoImage"
                                    :fileSize="10" :disabled="judgeWrite('jnpf_zcgl_zcdj_photo_jnpf_photoImage')"
                                    sizeUnit="MB" :limit="9"
                    >
                    </JNPF-UploadImg>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label-width="0">
                    <JNPF-Text :style='{"width":"100%"}'
                               :textStyle='{"color":"#CCAEAE","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                               value="注:最多上传五张图片,单张图片最大支持10M、支持png/jpg/jpeg/gif格式" :closable="false"
                    >
                    </JNPF-Text>
                  </el-form-item>
                </el-col>
              </el-card>
            </template>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="变更数据">

          <el-form ref="elForm" :model="dataForm.newData" :rules="dataRule" size="small" label-width="130px"
                   label-position="right" :disabled="setting.readonly"
          >
            <template>
              <!--          v-if="!loading && formOperates"-->
              <el-card class="mb-20" shadow="always" header="照片信息">
                <el-col :span="24"
                >
                  <el-form-item label="流程标题"
                                prop="title"
                  >
                    <el-input v-model="dataForm.title" v-if="!setting.readonly"
                              placeholder="请输入" clearable :style='{"width":"100%"}'
                    >

                    </el-input>
                    <span class="value" v-if="setting.readonly">{{ dataForm.title || '-' }}</span>
                  </el-form-item>
                  <el-form-item label="变更说明"
                                prop="remarks"
                  >
                    <el-input v-model="dataForm.remarks" v-if="!setting.readonly"
                              placeholder="请输入"  :style='{"width":"100%"}' true
                              type="textarea" :autosize='{"minRows":4,"maxRows":4}'
                    >

                    </el-input>
                    <span class="value notes" v-if="setting.readonly">{{ dataForm.remarks || '-' }}</span>
                  </el-form-item>
                </el-col>
                <el-col :span="8" v-if="judgeShow('jnpf_zcgl_zcdj_photo_jnpf_photoTime')"
                >
                  <el-form-item label="近照日期"
                                prop="jnpf_zcgl_zcdj_photo_jnpf_photoTime"
                  >
                    <el-date-picker v-model=" dataForm.newData.jnpf_zcgl_zcdj_photo_jnpf_photoTime"
                                    placeholder="请选择" :disabled="judgeWrite('jnpf_zcgl_zcdj_photo_jnpf_photoTime')"
                                    clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
                                    value-format="timestamp"
                    >
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="24" v-if="judgeShow('jnpf_zcgl_zcdj_photo_jnpf_photoImage')"
                >
                  <el-form-item label="近照图片"
                                prop="jnpf_zcgl_zcdj_photo_jnpf_photoImage"
                  >
                    <JNPF-UploadImg v-model=" dataForm.newData.jnpf_zcgl_zcdj_photo_jnpf_photoImage"
                                    :fileSize="10" :disabled="judgeWrite('jnpf_zcgl_zcdj_photo_jnpf_photoImage')"
                                    sizeUnit="MB" :limit="9"
                    >
                    </JNPF-UploadImg>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label-width="0">
                    <JNPF-Text :style='{"width":"100%"}'
                               :textStyle='{"color":"#CCAEAE","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
                               value="注:最多上传五张图片,单张图片最大支持10M、支持png/jpg/jpeg/gif格式" :closable="false"
                    >
                    </JNPF-Text>
                  </el-form-item>
                </el-col>
              </el-card>
            </template>
          </el-form>
        </el-tab-pane>
      </el-tabs>


    </el-row>
    <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit"/>
    <SelectDialog v-if="selectDialogVisible" :config="addTableConf" :formData="dataForm" ref="selectDialog"
                  @select="addForSelect" @close="selectDialogVisible=false"
    />
  </div>
</template>

<script>
import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import SelectDialog from '@/components/SelectDialog'

export default {
  components: { SelectDialog },
  props: [],
  data() {
    return {
      zcNatureOptions: [],
      zcNatureProps: { 'label': 'fullName', 'value': 'id' },
      zcPurposeOptions: [],
      zcPurposeProps: { 'label': 'fullName', 'value': 'id' },
      zcSourceOptions: [],
      zcSourceProps: { 'label': 'fullName', 'value': 'id' },
      affiliatedUnitOptions: [],
      affiliatedUnitProps: { 'label': 'fullName', 'value': 'id' },
      managementUnitOptions: [],
      managementUnitProps: { 'label': 'fullName', 'value': 'id' },
      jnpf_zcgl_zcdj_warrant_jnpf_propertyRightOptions: [],
      jnpf_zcgl_zcdj_warrant_jnpf_propertyRightProps: { 'label': 'fullName', 'value': 'id' },
      jnpf_zcgl_zcdj_warrant_jnpf_useNatureOptions: [],
      jnpf_zcgl_zcdj_warrant_jnpf_useNatureProps: { 'label': 'fullName', 'value': 'id' },
      activexdivdv: '1',
      selectDialogVisible: false,
      tableKey: '',
      addTableConf: {},
      loading: false,
      visible: false,
      setting: {},
      eventType: '',
      userBoxVisible: false,
      tableRequiredData: {},
      primaryKeyPolicy: true,
      dataFormNew: {},
      dataForm: {
        oldData: {},
        newData: {},
        id: '',
        flowId: '',
        status: 1,
        candidateList: {},
        freeapproveruserid: '',
        branchList: [],
        errorRuleUserList: {},
        flowUrgent: 1,
        version: 0,
        flowtaskid: undefined,
        copyIds: '',
        project: '',
        customerName: '',
        contractNo: '',
        paymentBy: '',
        billType: '',
        expenseStartDate: '',
        expenseEndDate: '',
        planReceiptDate: '',
        billRemark: '',
        zcbillitemList: []
      },
      dataRule:
        {},
      zcgl_cw_bill_itemexpenseItemOptions: [{ 'fullName': '选项一', 'id': '1' }, { 'fullName': '选项二', 'id': '2' }],
      zcgl_cw_bill_itemexpenseItemProps: { 'label': 'fullName', 'value': 'id' }
    }
  },
  computed: {
    formOperates() {
      return this.setting.formOperates
    }
  },
  watch: {},
  created() {
    // this.getColumnList(),
    this.getzcNatureOptions()
    this.getzcPurposeOptions()
    this.getzcSourceOptions()
    this.getaffiliatedUnitOptions()
    this.getmanagementUnitOptions()
    this.dataAll()

  },
  mounted() {
  },
  methods: {
    getzcNatureOptions() {
      getDictionaryDataSelector('610823452110094661').then(res => {
        this.zcNatureOptions = res.data.list
      })
    },
    getzcPurposeOptions() {
      getDictionaryDataSelector('610823865056100677').then(res => {
        this.zcPurposeOptions = res.data.list
      })
    },
    getzcSourceOptions() {
      getDictionaryDataSelector('610823965094445381').then(res => {
        this.zcSourceOptions = res.data.list
      })
    },
    getaffiliatedUnitOptions() {
      getDictionaryDataSelector('610824055188095301').then(res => {
        this.affiliatedUnitOptions = res.data.list
      })
    },
    getmanagementUnitOptions() {
      getDictionaryDataSelector('610824142995849541').then(res => {
        this.managementUnitOptions = res.data.list
      })
    },
    getjnpf_zcgl_zcdj_warrant_jnpf_propertyRightOptions() {
      getDictionaryDataSelector('610826202277478725').then(res => {
        this.jnpf_zcgl_zcdj_warrant_jnpf_propertyRightOptions = res.data.list
      })
    },
    getjnpf_zcgl_zcdj_warrant_jnpf_useNatureOptions() {
      getDictionaryDataSelector('610826295164535109').then(res => {
        this.jnpf_zcgl_zcdj_warrant_jnpf_useNatureOptions = res.data.list
      })
    },
    updateDataRule() {
      let newRules = {}
      for (let i = 0; i < this.setting.formOperates.length; i++) {
        const item = this.setting.formOperates[i]
        if (!item.id.includes('-')) {
          const newRulesItem = {
            required: item.required || false,
            message: item.name + '不能为空',
            trigger: item.trigger || 'blur'
          }
          if (!this.dataRule.hasOwnProperty(item.id)) {
            if (item.required) this.$set(newRules, item.id, [newRulesItem])
          } else {
            let withoutRequiredItem = true
            for (let i = 0; i < this.dataRule[item.id].length; i++) {
              if (this.dataRule[item.id][i].hasOwnProperty('required')) {
                this.dataRule[item.id][i].required = item.required || false
                withoutRequiredItem = false
              }
            }
            if (withoutRequiredItem && item.required) this.dataRule[item.id].push(newRulesItem)
          }
        } else {
          let key = item.id.split('-')[0]
          let newId = item.id.split('-')[1]
          let newItem = {
            ...item,
            id: newId
          }
          if (!this.tableRequiredData.hasOwnProperty(key)) {
            this.$set(this.tableRequiredData, key, [newItem])
          } else {
            this.tableRequiredData[key].push(newItem)
          }
        }
      }
      this.dataRule = { ...this.dataRule, ...newRules }
    },
    exist() {
      let isOk = true
      let messageList = []
      for (let key in this.tableRequiredData) {
        let arr = this.tableRequiredData[key].filter((o) => o.required) || []
        for (let k = 0; k < arr.length; k++) {
          for (let i = 0; i < this.dataForm[key].length; i++) {
            let id = arr[k].id
            let name = arr[k].name
            let _data = this.dataForm[key][i][id]
            let boo = true
            if (Array.isArray(_data)) {
              boo = !this.jnpf.isEmptyArray(_data)
            } else {
              boo = !this.jnpf.isEmpty(_data)
            }
            if (!boo) {
              messageList.push(name + '不能为空')
            }
          }
        }
      }
      isOk = messageList.length == 0
      if (messageList.length > 0) {
        this.$message.error(messageList[0], 1000)
      }
      return isOk
    },
    dataAll() {
    },
    goBack() {
      this.$emit('refresh')
    },
    init(data) {
      if (data.flowTaskInfo != null) {

        console.log(data.flowTaskInfo)
        this.dataInfo3(data.flowTaskInfo.flowFormContentJson)

        this.$emit('setPageLoad')
        this.$store.commit('generator/UPDATE_RELATION_DATA', {})
        this.loading = false
        // this.dataForm.id = data.id || "";
        this.setting = data
        this.setting.readOnly=true
        // this.visible = true;
        this.updateDataRule()

      } else {
        this.$store.commit('generator/UPDATE_RELATION_DATA', {})
        this.loading = true
        this.dataForm.id = data.id || ''
        this.setting = data
        this.visible = true

        this.$nextTick(() => {
          // this.$refs['elForm'].resetFields();
          if (this.dataForm.id) {
            let url = '/api/example/ZcglZcdjInfo/' + this.dataForm.id
            if (this.dataForm.flowtaskid) {
              url += '?flowtaskid=' + this.dataForm.flowtaskid
            }
            request({
              url: url,
              method: 'get'
            }).then(res => {
              this.dataInfo(res.data)
              this.updateDataRule()
            })
          }
          this.loading = false
          this.$emit('setPageLoad')
        })
      }

    },
    // 表单提交
    dataFormSubmit(eventType, flowUrgent) {
      this.$refs['elForm'].validate((valid) => {
        if (valid) {
          if (!this.exist()) return
          if (eventType === 'audit' || eventType === 'reject') {
            var _data = this.dataList()
            this.$emit('eventReceiver', _data, eventType)
            return
          }
          this.dataForm.status = eventType === 'submit' ? 0 : 1
          this.dataForm.flowUrgent = flowUrgent
          this.dataForm.flowId = this.setting.flowId
          this.eventType = eventType
          if (this.eventType === 'submit') {
            this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
              type: 'warning'
            }).then(() => {
              this.request()
            }).catch(() => {
            })
          } else {
            this.request()
          }
        }
      })
    },
    request() {
      var _data = this.dataList()
      var id = this.dataForm.id
      delete this.dataForm.id
      _data.type = '4'
      _data.zcdgId = id
      _data.newData.zcgl_zcdj_area = {}
      _data.newData.zcgl_zcdj_area.buildingArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_buildingArea
      _data.newData.zcgl_zcdj_area.landArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_landArea
      _data.newData.zcgl_zcdj_area.sharedLandArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_sharedLandArea
      _data.newData.zcgl_zcdj_area.buildingMeasurementArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_buildingMeasurementArea
      _data.newData.zcgl_zcdj_area.landSurveyArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_landSurveyArea
      _data.newData.zcgl_zcdj_area.exclusiveArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_exclusiveArea
      _data.newData.zcgl_zcdj_area.sharedArea = _data.newData.jnpf_zcgl_zcdj_area_jnpf_sharedArea

      if (!this.dataForm.id) {
        request({
          url: '/api/example/ZcglZcdjInfoChange',
          method: 'post',
          data: _data
        }).then((res) => {
          this.$message({
            message: res.msg,
            type: 'success',
            duration: 1000,
            onClose: () => {
              this.visible = false
              this.$emit('close', true)
            }
          })
        })
      } else {
        request({
          url: '/api/ZcglCwBillChange/' + this.dataForm.id,
          method: 'PUT',
          data: _data
        }).then((res) => {
          this.$message({
            message: res.msg,
            type: 'success',
            duration: 1000,
            onClose: () => {
              this.visible = false
              this.$emit('close', true)
            }
          })
        })
      }
    },
    judgeShow(id) {
      if (!this.setting.formOperates || !this.setting.formOperates.length) return true
      let arr = this.setting.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return true
      let item = arr[0]
      return item.read
    },
    judgeWrite(id) {
      if (!this.setting.formOperates || !this.setting.formOperates.length) return false
      let arr = this.setting.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return true
      let item = arr[0]
      return !item.write
    },
    judgeRequired(id) {
      if (!this.setting.formOperates || !this.setting.formOperates.length) return false
      let arr = this.setting.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return true
      let item = arr[0]
      return item.required
    },
    addzcbillitemList() {
      this.tableKey = 'zcbillitemList'
      let item = {
        expenseItem: undefined,
        receiveAmount: undefined
      }
      this.dataForm.zcbillitemList.push(item)
    },
    delzcbillitemList(index) {
      this.dataForm.zcbillitemList.splice(index, 1)
    },
    dataList() {
      var _data = JSON.parse(JSON.stringify(this.dataForm))
      // for(let i=0;i<_data.zcbillitemList.length;i++){
      //   var _list = _data.zcbillitemList[i];
      //   _list.expenseItem = _list.expenseItem
      // }
      return _data
    },
    dataInfo(dataAll) {
      let _dataAll = dataAll
      if (_dataAll.zcFile != null && dataAll.zcFile != '') {
        _dataAll.zcFile = JSON.parse(_dataAll.zcFile)

      } else {
        _dataAll.zcFile = ''
      }
      if (_dataAll.zcFmImage != null && dataAll.zcFmImage != '') {
        _dataAll.zcFmImage = JSON.parse(_dataAll.zcFmImage)

      } else {
        _dataAll.zcFmImage = ''
      }

      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_propertyRight = _dataAll.zcgl_zcdj_warrant.propertyRight
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_warrantNumber = _dataAll.zcgl_zcdj_warrant.warrantNumber
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_landUse = _dataAll.zcgl_zcdj_warrant.landUse
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_housePurpose = _dataAll.zcgl_zcdj_warrant.housePurpose
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_zzPropertyOwner = _dataAll.zcgl_zcdj_warrant.zzPropertyOwner
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_xzPropertyOwner = _dataAll.zcgl_zcdj_warrant.xzPropertyOwner
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_address = _dataAll.zcgl_zcdj_warrant.address
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_useNature = _dataAll.zcgl_zcdj_warrant.useNature
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_buildings = _dataAll.zcgl_zcdj_warrant.buildings
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_layers = _dataAll.zcgl_zcdj_warrant.layers
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_numberFloors = _dataAll.zcgl_zcdj_warrant.numberFloors
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_startTime = _dataAll.zcgl_zcdj_warrant.startTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_endTime = _dataAll.zcgl_zcdj_warrant.endTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_issuanceTime = _dataAll.zcgl_zcdj_warrant.issuanceTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_custodyLocation = _dataAll.zcgl_zcdj_warrant.custodyLocation
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_notes = _dataAll.zcgl_zcdj_warrant.notes
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_productionFile = JSON.parse(_dataAll.zcgl_zcdj_warrant.productionFile)
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_productionImage = JSON.parse(_dataAll.zcgl_zcdj_warrant.productionImage)
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingArea = _dataAll.zcgl_zcdj_area.buildingArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landArea = _dataAll.zcgl_zcdj_area.landArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedLandArea = _dataAll.zcgl_zcdj_area.sharedLandArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingMeasurementArea = _dataAll.zcgl_zcdj_area.buildingMeasurementArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landSurveyArea = _dataAll.zcgl_zcdj_area.landSurveyArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_exclusiveArea = _dataAll.zcgl_zcdj_area.exclusiveArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedArea = _dataAll.zcgl_zcdj_area.sharedArea
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoTime = _dataAll.zcgl_zcdj_photo.photoTime
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoImage = JSON.parse(_dataAll.zcgl_zcdj_photo.photoImage)
      this.dataForm.oldData = _dataAll

      this.dataForm.newData = JSON.parse(JSON.stringify(this.dataForm.oldData))
    },
    dataInfo2(dataAll) {
      let _dataAll = dataAll

      // for(let i=0;i<_dataAll.zcbillitemList.length;i++){
      //   var _list = _dataAll.zcbillitemList[i];
      //   _list.expenseItem = _list.expenseItem
      // }
      if (_dataAll.zcFile != null && dataAll.zcFile != '') {
        _dataAll.zcFile = JSON.parse(_dataAll.zcFile)

      } else {
        _dataAll.zcFile = ''
      }
      if (_dataAll.zcFmImage != null && dataAll.zcFmImage != '') {
        _dataAll.zcFmImage = JSON.parse(_dataAll.zcFmImage)

      } else {
        _dataAll.zcFmImage = ''
      }

      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingArea = _dataAll.zcgl_zcdj_area.buildingArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landArea = _dataAll.zcgl_zcdj_area.landArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedLandArea = _dataAll.zcgl_zcdj_area.sharedLandArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingMeasurementArea = _dataAll.zcgl_zcdj_area.buildingMeasurementArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landSurveyArea = _dataAll.zcgl_zcdj_area.landSurveyArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_exclusiveArea = _dataAll.zcgl_zcdj_area.exclusiveArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedArea = _dataAll.zcgl_zcdj_area.sharedArea
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoTime = _dataAll.zcgl_zcdj_photo.photoTime
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoImage = JSON.parse(_dataAll.zcgl_zcdj_photo.photoImage)
      this.dataForm = _dataAll
    },
    dataInfo3(dataAll) {

      let _dataAll = JSON.parse(dataAll)

      console.log('asas阿萨·' + _dataAll)

      function safeParseJSON(data) {
        try {
          return typeof data === 'string' ? JSON.parse(data) : data
        } catch (e) {
          console.error('Parsing error:', e)
          return null // 或者根据需要返回其他默认值
        }
      }

// 处理 oldData 中的 zcFile 和 zcFmImage
      if (_dataAll.oldData) {
        let oldDataParsed = safeParseJSON(_dataAll.oldData)
        if (oldDataParsed) {
          if (oldDataParsed.zcFile != '') {
            oldDataParsed.zcFile = oldDataParsed.zcFile ? JSON.parse(oldDataParsed.zcFile) : []

          }
          if (oldDataParsed.zcFmImage != '') {
            oldDataParsed.zcFmImage = oldDataParsed.zcFmImage ? JSON.parse(oldDataParsed.zcFmImage) : []

          }

        }
      }

// 处理 newData 中的 zcFile 和 zcFmImage
      if (_dataAll.newData) {
        let newDataParsed = safeParseJSON(_dataAll.newData)
        if (newDataParsed) {
          if (newDataParsed.zcFile != '') {
            newDataParsed.zcFile = newDataParsed.zcFile ? JSON.parse(newDataParsed.zcFile) : []

          }
          if (newDataParsed.zcFmImage != '') {
            newDataParsed.zcFmImage = newDataParsed.zcFmImage ? JSON.parse(newDataParsed.zcFmImage) : []

          }

        }
      }

      this.dataForm = _dataAll
      if (typeof this.dataForm.oldData === 'string') {

        this.dataForm.oldData = JSON.parse(this.dataForm.oldData)

      } else {
        this.dataForm.oldData = this.dataForm.oldData
      }

      if (typeof this.dataForm.newData === 'string') {
        this.dataForm.newData = JSON.parse(this.dataForm.newData)

      } else {
        this.dataForm.newData = this.dataForm.newData
      }
    },
    dataInfo1(dataAll) {
      let _dataAll = dataAll
      // for(let i=0;i<_dataAll.zcbillitemList.length;i++){
      //   var _list = _dataAll.zcbillitemList[i];
      //   _list.expenseItem = _list.expenseItem
      // }
      if (_dataAll.zcFile != null && dataAll.zcFile != '') {
        _dataAll.zcFile = JSON.parse(_dataAll.zcFile)

      } else {
        _dataAll.zcFile = ''
      }
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_propertyRight = _dataAll.zcgl_zcdj_warrant.propertyRight
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_warrantNumber = _dataAll.zcgl_zcdj_warrant.warrantNumber
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_landUse = _dataAll.zcgl_zcdj_warrant.landUse
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_housePurpose = _dataAll.zcgl_zcdj_warrant.housePurpose
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_zzPropertyOwner = _dataAll.zcgl_zcdj_warrant.zzPropertyOwner
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_xzPropertyOwner = _dataAll.zcgl_zcdj_warrant.xzPropertyOwner
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_address = _dataAll.zcgl_zcdj_warrant.address
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_useNature = _dataAll.zcgl_zcdj_warrant.useNature
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_buildings = _dataAll.zcgl_zcdj_warrant.buildings
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_layers = _dataAll.zcgl_zcdj_warrant.layers
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_numberFloors = _dataAll.zcgl_zcdj_warrant.numberFloors
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_startTime = _dataAll.zcgl_zcdj_warrant.startTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_endTime = _dataAll.zcgl_zcdj_warrant.endTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_issuanceTime = _dataAll.zcgl_zcdj_warrant.issuanceTime
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_custodyLocation = _dataAll.zcgl_zcdj_warrant.custodyLocation
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_notes = _dataAll.zcgl_zcdj_warrant.notes
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_productionFile = JSON.parse(_dataAll.zcgl_zcdj_warrant.productionFile)
      _dataAll.jnpf_zcgl_zcdj_warrant_jnpf_productionImage = JSON.parse(_dataAll.zcgl_zcdj_warrant.productionImage)
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingArea = _dataAll.zcgl_zcdj_area.buildingArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landArea = _dataAll.zcgl_zcdj_area.landArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedLandArea = _dataAll.zcgl_zcdj_area.sharedLandArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_buildingMeasurementArea = _dataAll.zcgl_zcdj_area.buildingMeasurementArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_landSurveyArea = _dataAll.zcgl_zcdj_area.landSurveyArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_exclusiveArea = _dataAll.zcgl_zcdj_area.exclusiveArea
      _dataAll.jnpf_zcgl_zcdj_area_jnpf_sharedArea = _dataAll.zcgl_zcdj_area.sharedArea
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoTime = _dataAll.zcgl_zcdj_photo.photoTime
      _dataAll.jnpf_zcgl_zcdj_photo_jnpf_photoImage = JSON.parse(_dataAll.zcgl_zcdj_photo.photoImage)
      this.dataFormNew = _dataAll
    },
    addForSelect(data) {
      for (let i = 0; i < data.length; i++) {
        let item = data[i]
        this.dataForm[this.tableKey].push(item)
      }
    }
  }
}

</script>
<style scoped>
.el-textarea.is-disabled .el-textarea__inner{

  color: black!important;
}
.el-input.is-disabled .el-input__inner{
  color: black!important;

}
/deep/.el-input__inner{
  background: white !important;

}

/deep/.el-textarea__inner{
  background: white !important;
}
.el-input.is-disabled .el-input__inner{

  background: white !important;
}
</style>
